package tech.aistar.service.impl;

import org.apache.ibatis.session.SqlSession;
import tech.aistar.entity.User;
import tech.aistar.mapper.UserMapper;
import tech.aistar.service.IUserService;
import tech.aistar.util.MybatisUtil;

/**
 * @Author: lya
 * @Description: 本类的作用描述:业务逻辑层
 * @CreateDate: 2019/9/5
 * @Version: 1.0
 */
public class UserServiceImpl implements IUserService {

    @Override
    public User findByUsername(String username) {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);

        User user = userMapper.findByUsername(username);

        MybatisUtil.close(sqlSession);

        return user;
    }
}
